<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>商品待滞销报表</title>
<style type="text/css">
<!--
.STYLE1 {
	color: #FF0000;
	font-weight: bold;
}
.red,.red td{color:red !important;}
-->
</style>
<body class="withvernav">
<style type="text/css">
	thead tr td{
		vertical-align: middle ; text-align: center;
	}
	.stdtable tbody tr td {padding:3px 0px !important;}
</style>
<div class="bodywrapper"> {{include file='/public/leftmenu.tpl'}}
  <div class="centercontent">
    <div class="pageheader notab">
      <h1 class="pagetitle">商品待滞销报表</h1>
      <span class="pagedesc">通过设置的入库时间和滞销率，得出可以申请清仓的报表
  </span>
      <div class="menulist">
        <ul class="profile_summary">
       		<li><a href="/sales/goodsClearList"><span>历史清仓列表</span></a></li>
       </ul></div>
</div>
<!--pageheader-->
    
    <div id="contentwrapper" class="contentwrapper" >
      <div id="basicform" class="subcontent">
          <!--搜索栏-->
<div class="page">{{$pageList}} 计{{$datatotal}}条记录，共{{$totalpage}}页</div>
    <form class="stdform stdform2" method="get" action="/sales/ajaxbutton">
    	<input name="op" value="unSaleGoods" type="hidden">
      <div class="tableoptions" style="position:relative">
      <a href="javascript:void(0)" onClick="applyGoodsClear()" class="stdbtn btn_red"><span>申请待清仓</span></a> &nbsp; SKU：<input type="text" name="search_sku" id="search_sku" value="{{$search_sku}}" class="width100">&nbsp;仓位：<input type="text" name="positions" id="positions" class="width100" value="{{$positions}}" placeholder="仓位模糊搜索" style="width:100px;" />
       入库时间超过:<input type="text" name="limit_month" id="limit_month" class="width100" value="{{$limit_month}}" style="width:50px;" />个月({{$imit_month_date}})   &nbsp;滞销率大于:<input type="text" name="unsalelilv" id="unsalelilv" class="width100" style="width:60px;" value="{{$unsalelilv}}" />%
        <button class="btn btn_orange btn_search radius50">Search</button>
<div style="position:absolute;right:2px;top:14px;font-size:14px;padding-right:40px;">
 合计剩余库存：<strong class="STYLE1">{{$totaldata['total_stock']}}</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
总库存价值：<strong class="STYLE1">{{$totaldata['total_cost_price']}}</strong>
</div>
</div>
    </form>
    <form class="stdform stdform2" id="formlist" method="post" action="/sales/ajaxbutton?op=saveUnsgoodsClear">
    <input type="hidden" name="limit_month" id="limit_month" value="{{$limit_month}}" style="width:50px;" />
    <input type="hidden" name="unsalelilv" id="unsalelilv" style="width:60px;" value="{{$unsalelilv}}" />
    <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
    <thead>
    <tr valign="top" class="tableheader">
    <td style="text-align:center;"><input name="allchk" id="allchk" type="checkbox" onClick="allSelect('storeid[]')"></td>
      <th>商品编号</th>
      <th><b>名称</b></th>
      <th>仓库</th>
      <th>仓位</th>
      <th align="center"><strong>最后入库时间</strong></th>
      <th align="center"><strong>最后入库库存</strong></th>
      <th align="center"><strong>现剩余库存</strong></th>
      <th align="center"><strong>滞销率</strong></th>
      <th align="center"><b>库存价值</b></th>
      </tr>
            </thead>
          
             {{foreach from=$datalist item=res key=key}}
             <tr {{if $res.goods_name==''}} class="red"{{/if}}>
               <td class="head1" align="center"><input name="storeid[]" class="checkbox" type="checkbox" value="{{$res.goods_id}}"></td>
              <td class="head1" align="center"><a href="/product/productlist?other={{$res.goods_sku}}&filtertype=skuc" target="_blank">{{$res.goods_sku}}</a></td>
                <td class="head0" align="center" title="{{$res.goods_name}}">{{$res.goods_name|getstr:16:0}}</td>
                <td class="head0" align="center" title="{{$res.goods_name}}">{{$res.storagename}}</td>
                <td class="head0" align="center" title="{{$res.goods_name}}">{{$res.positions}}</td>
                <td class="head1" align="center">{{$res.insttime}}</td>
               <td class="head1" align="center">{{$res.newnum}}</td>
               <td class="head1" align="center">{{$res.stock}}</td>
               <td class="head1" align="center">{{$res.unsalelilv}}%</td>
               <td class="head1" align="center">{{$res.costprice}}</td>
               </tr>
            {{/foreach}}
          </table>
    </form>
      </div>
<div class="page">{{$pageList}} 计{{$datatotal}}条记录，共{{$totalpage}}页</div>
      </div>
<div style="position:absolute;z-index:999;top:105px;border:1px solid #666;left:220px;width:870px;background:#f5f5f5;padding:6px 10px;height:450px;margin-bottom:40px;display:none;" id="ajax_box">
<div style="padding-top:8px;padding-left:12px;height:28px;"><h4 style="float:left">选择要搜索的店铺</h4><span style="float:right">
  <input type="button" name="button" id="button" onClick="setShopInfo()" value="确定选择">&nbsp;&nbsp;
  <input type="button" value="关闭弹层" onClick="closeShowBox()">
</span></div>
<div id="shop_box" style="height:400px;overflow:auto"></div>
</div>
<script type="text/javascript">
	function applyGoodsClear(){
		var checkval=0;
		$(".checkbox").each(function(){
			if($(this).attr("checked")=='checked'){
				checkval=1;
			}	
		});
		if(checkval==0){
			alert('请先选择要清仓的商品');
			return ;
		}
		
		$("#formlist").submit();
	}
</script>
</body>
</html>